3.13.15 \(\int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx\) [1215]

3.13.15.1 Optimal result
3.13.15.2 Mathematica [A] (verified)
3.13.15.3 Rubi [A] (verified)
3.13.15.4 Maple [A] (verified)
3.13.15.5 Fricas [B] (verification not implemented)
3.13.15.6 Sympy [F(-2)]
3.13.15.7 Maxima [B] (verification not implemented)
3.13.15.8 Giac [B] (verification not implemented)
3.13.15.9 Mupad [B] (verification not implemented)

3.13.15.1 Optimal result

Integrand size = 25, antiderivative size = 279 \[ \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx=\frac {\left (a^3 c-3 a b^2 c-3 a^2 b d+b^3 d\right ) x}{\left (a^2+b^2\right )^3 \left (c^2+d^2\right )}-\frac {b^2 \left (8 a^3 b c d-6 a^4 d^2+b^4 \left (c^2-d^2\right )-3 a^2 b^2 \left (c^2+d^2\right )\right ) \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right )^3 (b c-a d)^3 f}-\frac {d^4 \log (c \cos (e+f x)+d \sin (e+f x))}{(b c-a d)^3 \left (c^2+d^2\right ) f}-\frac {b^2}{2 \left (a^2+b^2\right ) (b c-a d) f (a+b \tan (e+f x))^2}-\frac {b^2 \left (2 a b c-3 a^2 d-b^2 d\right )}{\left (a^2+b^2\right )^2 (b c-a d)^2 f (a+b \tan (e+f x))} \]

output
(a^3*c-3*a^2*b*d-3*a*b^2*c+b^3*d)*x/(a^2+b^2)^3/(c^2+d^2)-b^2*(8*a^3*b*c*d 
-6*a^4*d^2+b^4*(c^2-d^2)-3*a^2*b^2*(c^2+d^2))*ln(a*cos(f*x+e)+b*sin(f*x+e) 
)/(a^2+b^2)^3/(-a*d+b*c)^3/f-d^4*ln(c*cos(f*x+e)+d*sin(f*x+e))/(-a*d+b*c)^ 
3/(c^2+d^2)/f-1/2*b^2/(a^2+b^2)/(-a*d+b*c)/f/(a+b*tan(f*x+e))^2-b^2*(-3*a^ 
2*d+2*a*b*c-b^2*d)/(a^2+b^2)^2/(-a*d+b*c)^2/f/(a+b*tan(f*x+e))
 
3.13.15.2 Mathematica [A] (verified)

Time = 6.89 (sec) , antiderivative size = 529, normalized size of antiderivative = 1.90 \[ \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx=-\frac {b^2}{2 \left (a^2+b^2\right ) (b c-a d) f (a+b \tan (e+f x))^2}-\frac {-\frac {-\frac {b (b c-a d)^2 \left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d+\frac {\sqrt {-b^2} \left (a^3 c-3 a b^2 c-3 a^2 b d+b^3 d\right )}{b}\right ) \log \left (\sqrt {-b^2}-b \tan (e+f x)\right )}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}-\frac {2 b^3 \left (8 a^3 b c d-6 a^4 d^2+b^4 \left (c^2-d^2\right )-3 a^2 b^2 \left (c^2+d^2\right )\right ) \log (a+b \tan (e+f x))}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b (b c-a d)^2 \left (3 a^2 b c-b^3 c+a^3 d-3 a b^2 d+\frac {b \left (a^3 c-3 a b^2 c-3 a^2 b d+b^3 d\right )}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}+b \tan (e+f x)\right )}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}-\frac {2 b \left (a^2+b^2\right )^2 d^4 \log (c+d \tan (e+f x))}{(b c-a d) \left (c^2+d^2\right )}}{b \left (a^2+b^2\right ) (b c-a d) f}-\frac {-2 b^2 \left (a b c-a^2 d-b^2 d\right )-a \left (-2 a b^2 d+2 b^2 (b c-a d)\right )}{\left (a^2+b^2\right ) (b c-a d) f (a+b \tan (e+f x))}}{2 \left (a^2+b^2\right ) (b c-a d)} \]

input
Integrate[1/((a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])),x]
 
output
-1/2*b^2/((a^2 + b^2)*(b*c - a*d)*f*(a + b*Tan[e + f*x])^2) - (-((-((b*(b* 
c - a*d)^2*(3*a^2*b*c - b^3*c + a^3*d - 3*a*b^2*d + (Sqrt[-b^2]*(a^3*c - 3 
*a*b^2*c - 3*a^2*b*d + b^3*d))/b)*Log[Sqrt[-b^2] - b*Tan[e + f*x]])/((a^2 
+ b^2)*(c^2 + d^2))) - (2*b^3*(8*a^3*b*c*d - 6*a^4*d^2 + b^4*(c^2 - d^2) - 
 3*a^2*b^2*(c^2 + d^2))*Log[a + b*Tan[e + f*x]])/((a^2 + b^2)*(b*c - a*d)) 
 - (b*(b*c - a*d)^2*(3*a^2*b*c - b^3*c + a^3*d - 3*a*b^2*d + (b*(a^3*c - 3 
*a*b^2*c - 3*a^2*b*d + b^3*d))/Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[e + f*x] 
])/((a^2 + b^2)*(c^2 + d^2)) - (2*b*(a^2 + b^2)^2*d^4*Log[c + d*Tan[e + f* 
x]])/((b*c - a*d)*(c^2 + d^2)))/(b*(a^2 + b^2)*(b*c - a*d)*f)) - (-2*b^2*( 
a*b*c - a^2*d - b^2*d) - a*(-2*a*b^2*d + 2*b^2*(b*c - a*d)))/((a^2 + b^2)* 
(b*c - a*d)*f*(a + b*Tan[e + f*x])))/(2*(a^2 + b^2)*(b*c - a*d))
 
3.13.15.3 Rubi [A] (verified)

Time = 1.69 (sec) , antiderivative size = 340, normalized size of antiderivative = 1.22, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {3042, 4052, 27, 3042, 4132, 3042, 4134, 3042, 4013}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))}dx\)

\(\Big \downarrow \) 4052

\(\displaystyle -\frac {\int -\frac {2 \left (-d a^2+b c a-b^2 d \tan ^2(e+f x)-b^2 d-b (b c-a d) \tan (e+f x)\right )}{(a+b \tan (e+f x))^2 (c+d \tan (e+f x))}dx}{2 \left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {-d a^2+b c a-b^2 d \tan ^2(e+f x)-b^2 d-b (b c-a d) \tan (e+f x)}{(a+b \tan (e+f x))^2 (c+d \tan (e+f x))}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {-d a^2+b c a-b^2 d \tan (e+f x)^2-b^2 d-b (b c-a d) \tan (e+f x)}{(a+b \tan (e+f x))^2 (c+d \tan (e+f x))}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

\(\Big \downarrow \) 4132

\(\displaystyle \frac {-\frac {\int \frac {-d^2 a^4+2 b c d a^3-b^2 \left (c^2+2 d^2\right ) a^2+2 b (b c-a d)^2 \tan (e+f x) a+b^2 d \left (-3 d a^2+2 b c a-b^2 d\right ) \tan ^2(e+f x)+b^4 \left (c^2-d^2\right )}{(a+b \tan (e+f x)) (c+d \tan (e+f x))}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2 \left (-3 a^2 d+2 a b c-b^2 d\right )}{f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))}}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-\frac {\int \frac {-d^2 a^4+2 b c d a^3-b^2 \left (c^2+2 d^2\right ) a^2+2 b (b c-a d)^2 \tan (e+f x) a+b^2 d \left (-3 d a^2+2 b c a-b^2 d\right ) \tan (e+f x)^2+b^4 \left (c^2-d^2\right )}{(a+b \tan (e+f x)) (c+d \tan (e+f x))}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2 \left (-3 a^2 d+2 a b c-b^2 d\right )}{f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))}}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

\(\Big \downarrow \) 4134

\(\displaystyle \frac {-\frac {\frac {d^4 \left (a^2+b^2\right )^2 \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{\left (c^2+d^2\right ) (b c-a d)}+\frac {b^2 \left (-6 a^4 d^2+8 a^3 b c d-3 a^2 b^2 \left (c^2+d^2\right )+b^4 \left (c^2-d^2\right )\right ) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {x (b c-a d)^2 \left (a^3 c-3 a^2 b d-3 a b^2 c+b^3 d\right )}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2 \left (-3 a^2 d+2 a b c-b^2 d\right )}{f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))}}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-\frac {\frac {d^4 \left (a^2+b^2\right )^2 \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)}dx}{\left (c^2+d^2\right ) (b c-a d)}+\frac {b^2 \left (-6 a^4 d^2+8 a^3 b c d-3 a^2 b^2 \left (c^2+d^2\right )+b^4 \left (c^2-d^2\right )\right ) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)}dx}{\left (a^2+b^2\right ) (b c-a d)}-\frac {x (b c-a d)^2 \left (a^3 c-3 a^2 b d-3 a b^2 c+b^3 d\right )}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2 \left (-3 a^2 d+2 a b c-b^2 d\right )}{f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))}}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

\(\Big \downarrow \) 4013

\(\displaystyle \frac {-\frac {b^2 \left (-3 a^2 d+2 a b c-b^2 d\right )}{f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))}-\frac {\frac {d^4 \left (a^2+b^2\right )^2 \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right ) (b c-a d)}-\frac {x (b c-a d)^2 \left (a^3 c-3 a^2 b d-3 a b^2 c+b^3 d\right )}{\left (a^2+b^2\right ) \left (c^2+d^2\right )}+\frac {b^2 \left (-6 a^4 d^2+8 a^3 b c d-3 a^2 b^2 \left (c^2+d^2\right )+b^4 \left (c^2-d^2\right )\right ) \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right ) (b c-a d)}}{\left (a^2+b^2\right ) (b c-a d)}}{\left (a^2+b^2\right ) (b c-a d)}-\frac {b^2}{2 f \left (a^2+b^2\right ) (b c-a d) (a+b \tan (e+f x))^2}\)

input
Int[1/((a + b*Tan[e + f*x])^3*(c + d*Tan[e + f*x])),x]
 
output
-1/2*b^2/((a^2 + b^2)*(b*c - a*d)*f*(a + b*Tan[e + f*x])^2) + (-((-(((b*c 
- a*d)^2*(a^3*c - 3*a*b^2*c - 3*a^2*b*d + b^3*d)*x)/((a^2 + b^2)*(c^2 + d^ 
2))) + (b^2*(8*a^3*b*c*d - 6*a^4*d^2 + b^4*(c^2 - d^2) - 3*a^2*b^2*(c^2 + 
d^2))*Log[a*Cos[e + f*x] + b*Sin[e + f*x]])/((a^2 + b^2)*(b*c - a*d)*f) + 
((a^2 + b^2)^2*d^4*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((b*c - a*d)*(c^2 
 + d^2)*f))/((a^2 + b^2)*(b*c - a*d))) - (b^2*(2*a*b*c - 3*a^2*d - b^2*d)) 
/((a^2 + b^2)*(b*c - a*d)*f*(a + b*Tan[e + f*x])))/((a^2 + b^2)*(b*c - a*d 
))
 

3.13.15.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4013
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* 
(x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si 
n[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && 
 NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]
 

rule 4052
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m + 1)*((c 
+ d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d))), x] + Simp[1 
/((m + 1)*(a^2 + b^2)*(b*c - a*d))   Int[(a + b*Tan[e + f*x])^(m + 1)*(c + 
d*Tan[e + f*x])^n*Simp[a*(b*c - a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - 
 a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*Tan[e + f*x]^2, x], x], x] / 
; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] 
 && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && LtQ[m, -1] && (LtQ[n, 0] || Integ 
erQ[m]) &&  !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
 

rule 4132
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) 
 + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*b^2 - a*(b*B - a*C))*(a + b*Tan[e + 
 f*x])^(m + 1)*((c + d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(b*c - a*d)*(a^2 + 
b^2))), x] + Simp[1/((m + 1)*(b*c - a*d)*(a^2 + b^2))   Int[(a + b*Tan[e + 
f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[A*(a*(b*c - a*d)*(m + 1) - b^2*d* 
(m + n + 2)) + (b*B - a*C)*(b*c*(m + 1) + a*d*(n + 1)) - (m + 1)*(b*c - a*d 
)*(A*b - a*B - b*C)*Tan[e + f*x] - d*(A*b^2 - a*(b*B - a*C))*(m + n + 2)*Ta 
n[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ 
[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && LtQ[m, -1] && 
!(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
 

rule 4134
Int[((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^ 
2)/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)])), x_Symbol] :> Simp[(a*(A*c - c*C + B*d) + b*(B*c - A*d + C*d))*(x/ 
((a^2 + b^2)*(c^2 + d^2))), x] + (Simp[(A*b^2 - a*b*B + a^2*C)/((b*c - a*d) 
*(a^2 + b^2))   Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] - Sim 
p[(c^2*C - B*c*d + A*d^2)/((b*c - a*d)*(c^2 + d^2))   Int[(d - c*Tan[e + f* 
x])/(c + d*Tan[e + f*x]), x], x]) /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] 
&& NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
 
3.13.15.4 Maple [A] (verified)

Time = 1.58 (sec) , antiderivative size = 309, normalized size of antiderivative = 1.11

method result size
derivativedivides \(\frac {\frac {d^{4} \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (a d -b c \right )^{3} \left (c^{2}+d^{2}\right )}+\frac {b^{2}}{2 \left (a d -b c \right ) \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {b^{2} \left (3 a^{2} d -2 a b c +b^{2} d \right )}{\left (a d -b c \right )^{2} \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}-\frac {b^{2} \left (6 a^{4} d^{2}-8 a^{3} b c d +3 a^{2} b^{2} c^{2}+3 a^{2} b^{2} d^{2}-b^{4} c^{2}+b^{4} d^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a d -b c \right )^{3} \left (a^{2}+b^{2}\right )^{3}}+\frac {\frac {\left (-a^{3} d -3 a^{2} b c +3 a \,b^{2} d +b^{3} c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c -3 a^{2} b d -3 a \,b^{2} c +b^{3} d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3} \left (c^{2}+d^{2}\right )}}{f}\) \(309\)
default \(\frac {\frac {d^{4} \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (a d -b c \right )^{3} \left (c^{2}+d^{2}\right )}+\frac {b^{2}}{2 \left (a d -b c \right ) \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {b^{2} \left (3 a^{2} d -2 a b c +b^{2} d \right )}{\left (a d -b c \right )^{2} \left (a^{2}+b^{2}\right )^{2} \left (a +b \tan \left (f x +e \right )\right )}-\frac {b^{2} \left (6 a^{4} d^{2}-8 a^{3} b c d +3 a^{2} b^{2} c^{2}+3 a^{2} b^{2} d^{2}-b^{4} c^{2}+b^{4} d^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a d -b c \right )^{3} \left (a^{2}+b^{2}\right )^{3}}+\frac {\frac {\left (-a^{3} d -3 a^{2} b c +3 a \,b^{2} d +b^{3} c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a^{3} c -3 a^{2} b d -3 a \,b^{2} c +b^{3} d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right )^{3} \left (c^{2}+d^{2}\right )}}{f}\) \(309\)
norman \(\frac {\frac {a^{2} \left (a^{3} c -3 a^{2} b d -3 a \,b^{2} c +b^{3} d \right ) x}{\left (c^{2}+d^{2}\right ) \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {b^{2} \left (a^{3} c -3 a^{2} b d -3 a \,b^{2} c +b^{3} d \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right ) \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}+\frac {\left (3 a^{2} b^{4} d -2 a c \,b^{5}+b^{6} d \right ) \tan \left (f x +e \right )}{f b \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {7 a^{3} b^{4} d -5 a^{2} b^{5} c +3 a \,b^{6} d -b^{7} c}{2 f \,b^{2} \left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {2 b a \left (a^{3} c -3 a^{2} b d -3 a \,b^{2} c +b^{3} d \right ) x \tan \left (f x +e \right )}{\left (c^{2}+d^{2}\right ) \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right )}}{\left (a +b \tan \left (f x +e \right )\right )^{2}}+\frac {d^{4} \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (a^{3} c^{2} d^{3}+a^{3} d^{5}-3 a^{2} b \,c^{3} d^{2}-3 a^{2} b c \,d^{4}+3 a \,b^{2} c^{4} d +3 a \,b^{2} c^{2} d^{3}-b^{3} c^{5}-b^{3} c^{3} d^{2}\right )}-\frac {\left (a^{3} d +3 a^{2} b c -3 a \,b^{2} d -b^{3} c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right ) \left (c^{2}+d^{2}\right )}-\frac {b^{2} \left (6 a^{4} d^{2}-8 a^{3} b c d +3 a^{2} b^{2} c^{2}+3 a^{2} b^{2} d^{2}-b^{4} c^{2}+b^{4} d^{2}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right ) f}\) \(690\)
parallelrisch \(\text {Expression too large to display}\) \(2922\)
risch \(\text {Expression too large to display}\) \(4159\)

input
int(1/(a+b*tan(f*x+e))^3/(c+d*tan(f*x+e)),x,method=_RETURNVERBOSE)
 
output
1/f*(d^4/(a*d-b*c)^3/(c^2+d^2)*ln(c+d*tan(f*x+e))+1/2*b^2/(a*d-b*c)/(a^2+b 
^2)/(a+b*tan(f*x+e))^2+b^2*(3*a^2*d-2*a*b*c+b^2*d)/(a*d-b*c)^2/(a^2+b^2)^2 
/(a+b*tan(f*x+e))-b^2*(6*a^4*d^2-8*a^3*b*c*d+3*a^2*b^2*c^2+3*a^2*b^2*d^2-b 
^4*c^2+b^4*d^2)/(a*d-b*c)^3/(a^2+b^2)^3*ln(a+b*tan(f*x+e))+1/(a^2+b^2)^3/( 
c^2+d^2)*(1/2*(-a^3*d-3*a^2*b*c+3*a*b^2*d+b^3*c)*ln(1+tan(f*x+e)^2)+(a^3*c 
-3*a^2*b*d-3*a*b^2*c+b^3*d)*arctan(tan(f*x+e))))
 
3.13.15.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1927 vs. \(2 (277) = 554\).

Time = 0.85 (sec) , antiderivative size = 1927, normalized size of antiderivative = 6.91 \[ \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx=\text {Too large to display} \]

input
integrate(1/(a+b*tan(f*x+e))^3/(c+d*tan(f*x+e)),x, algorithm="fricas")
 
output
-1/2*((7*a^2*b^6 + b^8)*c^4 - 4*(4*a^3*b^5 + a*b^7)*c^3*d + (9*a^4*b^4 + 1 
0*a^2*b^6 + b^8)*c^2*d^2 - 4*(4*a^3*b^5 + a*b^7)*c*d^3 + 3*(3*a^4*b^4 + a^ 
2*b^6)*d^4 - 2*((a^5*b^3 - 3*a^3*b^5)*c^4 - (3*a^6*b^2 - 6*a^4*b^4 - a^2*b 
^6)*c^3*d + 3*(a^7*b - a^3*b^5)*c^2*d^2 - (a^8 + 6*a^6*b^2 - 3*a^4*b^4)*c* 
d^3 + (3*a^7*b - a^5*b^3)*d^4)*f*x + (12*a^3*b^5*c^3*d + 12*a^3*b^5*c*d^3 
- (5*a^2*b^6 - b^8)*c^4 - (7*a^4*b^4 + 6*a^2*b^6 - b^8)*c^2*d^2 - (7*a^4*b 
^4 + a^2*b^6)*d^4 - 2*((a^3*b^5 - 3*a*b^7)*c^4 - (3*a^4*b^4 - 6*a^2*b^6 - 
b^8)*c^3*d + 3*(a^5*b^3 - a*b^7)*c^2*d^2 - (a^6*b^2 + 6*a^4*b^4 - 3*a^2*b^ 
6)*c*d^3 + (3*a^5*b^3 - a^3*b^5)*d^4)*f*x)*tan(f*x + e)^2 + (8*a^5*b^3*c^3 
*d + 8*a^5*b^3*c*d^3 - (3*a^4*b^4 - a^2*b^6)*c^4 - 6*(a^6*b^2 + a^4*b^4)*c 
^2*d^2 - (6*a^6*b^2 + 3*a^4*b^4 + a^2*b^6)*d^4 + (8*a^3*b^5*c^3*d + 8*a^3* 
b^5*c*d^3 - (3*a^2*b^6 - b^8)*c^4 - 6*(a^4*b^4 + a^2*b^6)*c^2*d^2 - (6*a^4 
*b^4 + 3*a^2*b^6 + b^8)*d^4)*tan(f*x + e)^2 + 2*(8*a^4*b^4*c^3*d + 8*a^4*b 
^4*c*d^3 - (3*a^3*b^5 - a*b^7)*c^4 - 6*(a^5*b^3 + a^3*b^5)*c^2*d^2 - (6*a^ 
5*b^3 + 3*a^3*b^5 + a*b^7)*d^4)*tan(f*x + e))*log((b^2*tan(f*x + e)^2 + 2* 
a*b*tan(f*x + e) + a^2)/(tan(f*x + e)^2 + 1)) + ((a^6*b^2 + 3*a^4*b^4 + 3* 
a^2*b^6 + b^8)*d^4*tan(f*x + e)^2 + 2*(a^7*b + 3*a^5*b^3 + 3*a^3*b^5 + a*b 
^7)*d^4*tan(f*x + e) + (a^8 + 3*a^6*b^2 + 3*a^4*b^4 + a^2*b^6)*d^4)*log((d 
^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x + e)^2 + 1)) - 2*(3 
*(a^3*b^5 - a*b^7)*c^4 - (7*a^4*b^4 - 6*a^2*b^6 - b^8)*c^3*d + 4*(a^5*b...
 
3.13.15.6 Sympy [F(-2)]

Exception generated. \[ \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx=\text {Exception raised: NotImplementedError} \]

input
integrate(1/(a+b*tan(f*x+e))**3/(c+d*tan(f*x+e)),x)
 
output
Exception raised: NotImplementedError >> no valid subset found
 
3.13.15.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 801 vs. \(2 (277) = 554\).

Time = 0.42 (sec) , antiderivative size = 801, normalized size of antiderivative = 2.87 \[ \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx=-\frac {\frac {2 \, d^{4} \log \left (d \tan \left (f x + e\right ) + c\right )}{b^{3} c^{5} - 3 \, a b^{2} c^{4} d + 3 \, a^{2} b c d^{4} - a^{3} d^{5} + {\left (3 \, a^{2} b + b^{3}\right )} c^{3} d^{2} - {\left (a^{3} + 3 \, a b^{2}\right )} c^{2} d^{3}} - \frac {2 \, {\left ({\left (a^{3} - 3 \, a b^{2}\right )} c - {\left (3 \, a^{2} b - b^{3}\right )} d\right )} {\left (f x + e\right )}}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} c^{2} + {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} d^{2}} + \frac {2 \, {\left (8 \, a^{3} b^{3} c d - {\left (3 \, a^{2} b^{4} - b^{6}\right )} c^{2} - {\left (6 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} d^{2}\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{{\left (a^{6} b^{3} + 3 \, a^{4} b^{5} + 3 \, a^{2} b^{7} + b^{9}\right )} c^{3} - 3 \, {\left (a^{7} b^{2} + 3 \, a^{5} b^{4} + 3 \, a^{3} b^{6} + a b^{8}\right )} c^{2} d + 3 \, {\left (a^{8} b + 3 \, a^{6} b^{3} + 3 \, a^{4} b^{5} + a^{2} b^{7}\right )} c d^{2} - {\left (a^{9} + 3 \, a^{7} b^{2} + 3 \, a^{5} b^{4} + a^{3} b^{6}\right )} d^{3}} + \frac {{\left ({\left (3 \, a^{2} b - b^{3}\right )} c + {\left (a^{3} - 3 \, a b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} c^{2} + {\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} d^{2}} + \frac {{\left (5 \, a^{2} b^{3} + b^{5}\right )} c - {\left (7 \, a^{3} b^{2} + 3 \, a b^{4}\right )} d + 2 \, {\left (2 \, a b^{4} c - {\left (3 \, a^{2} b^{3} + b^{5}\right )} d\right )} \tan \left (f x + e\right )}{{\left (a^{6} b^{2} + 2 \, a^{4} b^{4} + a^{2} b^{6}\right )} c^{2} - 2 \, {\left (a^{7} b + 2 \, a^{5} b^{3} + a^{3} b^{5}\right )} c d + {\left (a^{8} + 2 \, a^{6} b^{2} + a^{4} b^{4}\right )} d^{2} + {\left ({\left (a^{4} b^{4} + 2 \, a^{2} b^{6} + b^{8}\right )} c^{2} - 2 \, {\left (a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} c d + {\left (a^{6} b^{2} + 2 \, a^{4} b^{4} + a^{2} b^{6}\right )} d^{2}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left ({\left (a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} c^{2} - 2 \, {\left (a^{6} b^{2} + 2 \, a^{4} b^{4} + a^{2} b^{6}\right )} c d + {\left (a^{7} b + 2 \, a^{5} b^{3} + a^{3} b^{5}\right )} d^{2}\right )} \tan \left (f x + e\right )}}{2 \, f} \]

input
integrate(1/(a+b*tan(f*x+e))^3/(c+d*tan(f*x+e)),x, algorithm="maxima")
 
output
-1/2*(2*d^4*log(d*tan(f*x + e) + c)/(b^3*c^5 - 3*a*b^2*c^4*d + 3*a^2*b*c*d 
^4 - a^3*d^5 + (3*a^2*b + b^3)*c^3*d^2 - (a^3 + 3*a*b^2)*c^2*d^3) - 2*((a^ 
3 - 3*a*b^2)*c - (3*a^2*b - b^3)*d)*(f*x + e)/((a^6 + 3*a^4*b^2 + 3*a^2*b^ 
4 + b^6)*c^2 + (a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6)*d^2) + 2*(8*a^3*b^3*c*d 
 - (3*a^2*b^4 - b^6)*c^2 - (6*a^4*b^2 + 3*a^2*b^4 + b^6)*d^2)*log(b*tan(f* 
x + e) + a)/((a^6*b^3 + 3*a^4*b^5 + 3*a^2*b^7 + b^9)*c^3 - 3*(a^7*b^2 + 3* 
a^5*b^4 + 3*a^3*b^6 + a*b^8)*c^2*d + 3*(a^8*b + 3*a^6*b^3 + 3*a^4*b^5 + a^ 
2*b^7)*c*d^2 - (a^9 + 3*a^7*b^2 + 3*a^5*b^4 + a^3*b^6)*d^3) + ((3*a^2*b - 
b^3)*c + (a^3 - 3*a*b^2)*d)*log(tan(f*x + e)^2 + 1)/((a^6 + 3*a^4*b^2 + 3* 
a^2*b^4 + b^6)*c^2 + (a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6)*d^2) + ((5*a^2*b^ 
3 + b^5)*c - (7*a^3*b^2 + 3*a*b^4)*d + 2*(2*a*b^4*c - (3*a^2*b^3 + b^5)*d) 
*tan(f*x + e))/((a^6*b^2 + 2*a^4*b^4 + a^2*b^6)*c^2 - 2*(a^7*b + 2*a^5*b^3 
 + a^3*b^5)*c*d + (a^8 + 2*a^6*b^2 + a^4*b^4)*d^2 + ((a^4*b^4 + 2*a^2*b^6 
+ b^8)*c^2 - 2*(a^5*b^3 + 2*a^3*b^5 + a*b^7)*c*d + (a^6*b^2 + 2*a^4*b^4 + 
a^2*b^6)*d^2)*tan(f*x + e)^2 + 2*((a^5*b^3 + 2*a^3*b^5 + a*b^7)*c^2 - 2*(a 
^6*b^2 + 2*a^4*b^4 + a^2*b^6)*c*d + (a^7*b + 2*a^5*b^3 + a^3*b^5)*d^2)*tan 
(f*x + e)))/f
 
3.13.15.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1092 vs. \(2 (277) = 554\).

Time = 0.58 (sec) , antiderivative size = 1092, normalized size of antiderivative = 3.91 \[ \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx=-\frac {\frac {2 \, d^{5} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{b^{3} c^{5} d - 3 \, a b^{2} c^{4} d^{2} + 3 \, a^{2} b c^{3} d^{3} + b^{3} c^{3} d^{3} - a^{3} c^{2} d^{4} - 3 \, a b^{2} c^{2} d^{4} + 3 \, a^{2} b c d^{5} - a^{3} d^{6}} - \frac {2 \, {\left (a^{3} c - 3 \, a b^{2} c - 3 \, a^{2} b d + b^{3} d\right )} {\left (f x + e\right )}}{a^{6} c^{2} + 3 \, a^{4} b^{2} c^{2} + 3 \, a^{2} b^{4} c^{2} + b^{6} c^{2} + a^{6} d^{2} + 3 \, a^{4} b^{2} d^{2} + 3 \, a^{2} b^{4} d^{2} + b^{6} d^{2}} + \frac {{\left (3 \, a^{2} b c - b^{3} c + a^{3} d - 3 \, a b^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{6} c^{2} + 3 \, a^{4} b^{2} c^{2} + 3 \, a^{2} b^{4} c^{2} + b^{6} c^{2} + a^{6} d^{2} + 3 \, a^{4} b^{2} d^{2} + 3 \, a^{2} b^{4} d^{2} + b^{6} d^{2}} - \frac {2 \, {\left (3 \, a^{2} b^{5} c^{2} - b^{7} c^{2} - 8 \, a^{3} b^{4} c d + 6 \, a^{4} b^{3} d^{2} + 3 \, a^{2} b^{5} d^{2} + b^{7} d^{2}\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{6} b^{4} c^{3} + 3 \, a^{4} b^{6} c^{3} + 3 \, a^{2} b^{8} c^{3} + b^{10} c^{3} - 3 \, a^{7} b^{3} c^{2} d - 9 \, a^{5} b^{5} c^{2} d - 9 \, a^{3} b^{7} c^{2} d - 3 \, a b^{9} c^{2} d + 3 \, a^{8} b^{2} c d^{2} + 9 \, a^{6} b^{4} c d^{2} + 9 \, a^{4} b^{6} c d^{2} + 3 \, a^{2} b^{8} c d^{2} - a^{9} b d^{3} - 3 \, a^{7} b^{3} d^{3} - 3 \, a^{5} b^{5} d^{3} - a^{3} b^{7} d^{3}} + \frac {9 \, a^{2} b^{6} c^{2} \tan \left (f x + e\right )^{2} - 3 \, b^{8} c^{2} \tan \left (f x + e\right )^{2} - 24 \, a^{3} b^{5} c d \tan \left (f x + e\right )^{2} + 18 \, a^{4} b^{4} d^{2} \tan \left (f x + e\right )^{2} + 9 \, a^{2} b^{6} d^{2} \tan \left (f x + e\right )^{2} + 3 \, b^{8} d^{2} \tan \left (f x + e\right )^{2} + 22 \, a^{3} b^{5} c^{2} \tan \left (f x + e\right ) - 2 \, a b^{7} c^{2} \tan \left (f x + e\right ) - 58 \, a^{4} b^{4} c d \tan \left (f x + e\right ) - 12 \, a^{2} b^{6} c d \tan \left (f x + e\right ) - 2 \, b^{8} c d \tan \left (f x + e\right ) + 42 \, a^{5} b^{3} d^{2} \tan \left (f x + e\right ) + 26 \, a^{3} b^{5} d^{2} \tan \left (f x + e\right ) + 8 \, a b^{7} d^{2} \tan \left (f x + e\right ) + 14 \, a^{4} b^{4} c^{2} + 3 \, a^{2} b^{6} c^{2} + b^{8} c^{2} - 36 \, a^{5} b^{3} c d - 16 \, a^{3} b^{5} c d - 4 \, a b^{7} c d + 25 \, a^{6} b^{2} d^{2} + 19 \, a^{4} b^{4} d^{2} + 6 \, a^{2} b^{6} d^{2}}{{\left (a^{6} b^{3} c^{3} + 3 \, a^{4} b^{5} c^{3} + 3 \, a^{2} b^{7} c^{3} + b^{9} c^{3} - 3 \, a^{7} b^{2} c^{2} d - 9 \, a^{5} b^{4} c^{2} d - 9 \, a^{3} b^{6} c^{2} d - 3 \, a b^{8} c^{2} d + 3 \, a^{8} b c d^{2} + 9 \, a^{6} b^{3} c d^{2} + 9 \, a^{4} b^{5} c d^{2} + 3 \, a^{2} b^{7} c d^{2} - a^{9} d^{3} - 3 \, a^{7} b^{2} d^{3} - 3 \, a^{5} b^{4} d^{3} - a^{3} b^{6} d^{3}\right )} {\left (b \tan \left (f x + e\right ) + a\right )}^{2}}}{2 \, f} \]

input
integrate(1/(a+b*tan(f*x+e))^3/(c+d*tan(f*x+e)),x, algorithm="giac")
 
output
-1/2*(2*d^5*log(abs(d*tan(f*x + e) + c))/(b^3*c^5*d - 3*a*b^2*c^4*d^2 + 3* 
a^2*b*c^3*d^3 + b^3*c^3*d^3 - a^3*c^2*d^4 - 3*a*b^2*c^2*d^4 + 3*a^2*b*c*d^ 
5 - a^3*d^6) - 2*(a^3*c - 3*a*b^2*c - 3*a^2*b*d + b^3*d)*(f*x + e)/(a^6*c^ 
2 + 3*a^4*b^2*c^2 + 3*a^2*b^4*c^2 + b^6*c^2 + a^6*d^2 + 3*a^4*b^2*d^2 + 3* 
a^2*b^4*d^2 + b^6*d^2) + (3*a^2*b*c - b^3*c + a^3*d - 3*a*b^2*d)*log(tan(f 
*x + e)^2 + 1)/(a^6*c^2 + 3*a^4*b^2*c^2 + 3*a^2*b^4*c^2 + b^6*c^2 + a^6*d^ 
2 + 3*a^4*b^2*d^2 + 3*a^2*b^4*d^2 + b^6*d^2) - 2*(3*a^2*b^5*c^2 - b^7*c^2 
- 8*a^3*b^4*c*d + 6*a^4*b^3*d^2 + 3*a^2*b^5*d^2 + b^7*d^2)*log(abs(b*tan(f 
*x + e) + a))/(a^6*b^4*c^3 + 3*a^4*b^6*c^3 + 3*a^2*b^8*c^3 + b^10*c^3 - 3* 
a^7*b^3*c^2*d - 9*a^5*b^5*c^2*d - 9*a^3*b^7*c^2*d - 3*a*b^9*c^2*d + 3*a^8* 
b^2*c*d^2 + 9*a^6*b^4*c*d^2 + 9*a^4*b^6*c*d^2 + 3*a^2*b^8*c*d^2 - a^9*b*d^ 
3 - 3*a^7*b^3*d^3 - 3*a^5*b^5*d^3 - a^3*b^7*d^3) + (9*a^2*b^6*c^2*tan(f*x 
+ e)^2 - 3*b^8*c^2*tan(f*x + e)^2 - 24*a^3*b^5*c*d*tan(f*x + e)^2 + 18*a^4 
*b^4*d^2*tan(f*x + e)^2 + 9*a^2*b^6*d^2*tan(f*x + e)^2 + 3*b^8*d^2*tan(f*x 
 + e)^2 + 22*a^3*b^5*c^2*tan(f*x + e) - 2*a*b^7*c^2*tan(f*x + e) - 58*a^4* 
b^4*c*d*tan(f*x + e) - 12*a^2*b^6*c*d*tan(f*x + e) - 2*b^8*c*d*tan(f*x + e 
) + 42*a^5*b^3*d^2*tan(f*x + e) + 26*a^3*b^5*d^2*tan(f*x + e) + 8*a*b^7*d^ 
2*tan(f*x + e) + 14*a^4*b^4*c^2 + 3*a^2*b^6*c^2 + b^8*c^2 - 36*a^5*b^3*c*d 
 - 16*a^3*b^5*c*d - 4*a*b^7*c*d + 25*a^6*b^2*d^2 + 19*a^4*b^4*d^2 + 6*a^2* 
b^6*d^2)/((a^6*b^3*c^3 + 3*a^4*b^5*c^3 + 3*a^2*b^7*c^3 + b^9*c^3 - 3*a^...
 
3.13.15.9 Mupad [B] (verification not implemented)

Time = 14.18 (sec) , antiderivative size = 609, normalized size of antiderivative = 2.18 \[ \int \frac {1}{(a+b \tan (e+f x))^3 (c+d \tan (e+f x))} \, dx=\frac {d^4\,\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}{f\,{\left (a\,d-b\,c\right )}^3\,\left (c^2+d^2\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}{2\,f\,\left (a^3\,c\,1{}\mathrm {i}-a^3\,d+b^3\,c+b^3\,d\,1{}\mathrm {i}-a\,b^2\,c\,3{}\mathrm {i}-3\,a^2\,b\,c+3\,a\,b^2\,d-a^2\,b\,d\,3{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}{2\,f\,\left (a^3\,c\,1{}\mathrm {i}+a^3\,d-b^3\,c+b^3\,d\,1{}\mathrm {i}-a\,b^2\,c\,3{}\mathrm {i}+3\,a^2\,b\,c-3\,a\,b^2\,d-a^2\,b\,d\,3{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (b^4\,\left (3\,a^2\,c^2+3\,a^2\,d^2\right )-b^6\,\left (c^2-d^2\right )+6\,a^4\,b^2\,d^2-8\,a^3\,b^3\,c\,d\right )}{f\,\left (a^9\,d^3-3\,a^8\,b\,c\,d^2+3\,a^7\,b^2\,c^2\,d+3\,a^7\,b^2\,d^3-a^6\,b^3\,c^3-9\,a^6\,b^3\,c\,d^2+9\,a^5\,b^4\,c^2\,d+3\,a^5\,b^4\,d^3-3\,a^4\,b^5\,c^3-9\,a^4\,b^5\,c\,d^2+9\,a^3\,b^6\,c^2\,d+a^3\,b^6\,d^3-3\,a^2\,b^7\,c^3-3\,a^2\,b^7\,c\,d^2+3\,a\,b^8\,c^2\,d-b^9\,c^3\right )}-\frac {\frac {-7\,d\,a^3\,b^2+5\,c\,a^2\,b^3-3\,d\,a\,b^4+c\,b^5}{2\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )\,\left (a^4+2\,a^2\,b^2+b^4\right )}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (3\,d\,a^2\,b^3-2\,c\,a\,b^4+d\,b^5\right )}{\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )\,\left (a^4+2\,a^2\,b^2+b^4\right )}}{f\,\left (a^2+2\,a\,b\,\mathrm {tan}\left (e+f\,x\right )+b^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )} \]

input
int(1/((a + b*tan(e + f*x))^3*(c + d*tan(e + f*x))),x)
 
output
log(tan(e + f*x) - 1i)/(2*f*(a^3*c*1i - a^3*d + b^3*c + b^3*d*1i - a*b^2*c 
*3i - 3*a^2*b*c + 3*a*b^2*d - a^2*b*d*3i)) - ((b^5*c + 5*a^2*b^3*c - 7*a^3 
*b^2*d - 3*a*b^4*d)/(2*(a^2*d^2 + b^2*c^2 - 2*a*b*c*d)*(a^4 + b^4 + 2*a^2* 
b^2)) - (tan(e + f*x)*(b^5*d + 3*a^2*b^3*d - 2*a*b^4*c))/((a^2*d^2 + b^2*c 
^2 - 2*a*b*c*d)*(a^4 + b^4 + 2*a^2*b^2)))/(f*(a^2 + b^2*tan(e + f*x)^2 + 2 
*a*b*tan(e + f*x))) - log(tan(e + f*x) + 1i)/(2*f*(a^3*c*1i + a^3*d - b^3* 
c + b^3*d*1i - a*b^2*c*3i + 3*a^2*b*c - 3*a*b^2*d - a^2*b*d*3i)) - (log(a 
+ b*tan(e + f*x))*(b^4*(3*a^2*c^2 + 3*a^2*d^2) - b^6*(c^2 - d^2) + 6*a^4*b 
^2*d^2 - 8*a^3*b^3*c*d))/(f*(a^9*d^3 - b^9*c^3 - 3*a^2*b^7*c^3 - 3*a^4*b^5 
*c^3 - a^6*b^3*c^3 + a^3*b^6*d^3 + 3*a^5*b^4*d^3 + 3*a^7*b^2*d^3 - 3*a^2*b 
^7*c*d^2 + 9*a^3*b^6*c^2*d - 9*a^4*b^5*c*d^2 + 9*a^5*b^4*c^2*d - 9*a^6*b^3 
*c*d^2 + 3*a^7*b^2*c^2*d + 3*a*b^8*c^2*d - 3*a^8*b*c*d^2)) + (d^4*log(c + 
d*tan(e + f*x)))/(f*(a*d - b*c)^3*(c^2 + d^2))